package pack0910;

public class Work01 {

    public static void a() {
        // 这个本来是main写的
        System.out.println("我是,张三！");
        String name = "张三";
        System.out.println("我是，" + name + "!");
    }

    public static void b() {
        /*
         ***********
         ***********
         ***********
         ***********
         */
        System.out.println("***********\n***********\n***********\n***********");
    }

    public static void c() {
        System.out.println("***********\n  ***********\n    ***********\n      ***********");
    }

    public static void d() {
        System.out.println("       *");
        System.out.println("     * * *");
        System.out.println("   * * * * *");
        System.out.println(" * * * * * * *");
        System.out.println("* * * * * * * * ");
    }

    public static void e() {
        System.out.println("善学如春起之苗");
        System.out.println("不见其增，日有所长");
        System.out.println("........");
        System.out.println("1234 1234");
        System.out.println("123,123");
        System.out.println("J\nA\nV\nA");
    }

    public static void f() {
        System.out.println(45);
        System.out.println(987);
        System.out.println(123);
        System.out.println(110);
        System.out.println(-89);
        System.out.println(8.99999878f);
        System.out.println(8.99999878d);
        float a = 9.7f;
        float b = 9;
        System.out.println(a);
        System.out.println(b);
    }

    public static void g() {
        System.out.println(true);
        System.out.println(false);
    }

    public static void h() {
        byte a = 99;
        byte b = 109;
        short c = 31000;
        short d = 20000;
        int e = 89765;
        int f = 9999876;
        long g = 198273273723L;
        long h = 2839283293L;
        System.out.println(a);
        System.out.println(b);
        System.out.println(c);
        System.out.println(d);
        System.out.println(e);
        System.out.println(f);
        System.out.println(g);
        System.out.println(h);
        System.out.println("-----------------------------------");
        byte i1 = 9;
        byte i2 = 9;
        System.out.println(a + b);
        // byte+byte = int
        //byte a1 = a + b;
        // byte a2 = i1 + i2;
        //System.out.println(a1);
    }

    public static void i() {
        float a1 = 9.3f;
        float a2 = 9.7F;
        double b1 = 9.66;
        double b2 = 9.109d;
        System.out.println(a1);
        System.out.println(a2);
        System.out.println(b1);
        System.out.println(b2);
    }

    public static void j() {
        char a1 = '张';
        char a2 = 32455;
        System.out.println(a1);
        System.out.println(a2);
        // 输出ASCII码
        System.out.println(a1 + 0);
        int asc = a1;
        System.out.println(asc);
    }

    public static void k() {
        int a = 19;
        int b = 33;
        // 两个数交换，需要第三个数
        int c = a;
        a = b;
        b = c;
        System.out.println("a:" + a + ",b:" + b);
    }

    public static void l() {
        int a = (int) (Math.random() * 100 + 1);
        int b = (int) (Math.random() * 100 + 1);
        System.out.println("a:" + a + ",b:" + b);
        System.out.println(a + b);
        System.out.println(a - b);
        System.out.println(a * b);
        System.out.println(a / b);
        System.out.println(a % b);
        System.out.println(a * 1.0 / b);
        System.out.println((a + 0.0) / b);
    }
    public static void m() {
        double a = (int) (Math.random() * 100 + 1);
        int b = (int) (Math.random() * 100 + 1);
        System.out.println("a:" + a + ",b:" + b);
        System.out.println(a + b);
        System.out.println(a - b);
        System.out.println(a * b);
        System.out.println(a / b);
        System.out.println(a % b);
        System.out.println(a * 1.0 / b);
        System.out.println((a + 0.0) / b);
    }

    /*
        定义 byte 类型变量，并赋值为 10，不换行输出类型说明，换行输出变量值。
        4. 定义 short 类型变量，并赋值为 100，不换行输出类型说明，换行输出变量值。
        5. 定义 int 类型变量，并赋值为 1000，不换行输出类型说明，换行输出变量值。
        6. 定义 long 类型变量，并赋值为 10000，不换行输出类型说明，换行输出变量值。
        7. 定义 float 类型变量，并赋值为 100000.0，不换行输出类型说明，换行输出变量值。
        8. 定义 double 类型变量，并赋值为 1000000.0，不换行输出类型说明，换行输出变量值。
        9. 定义 char 类型变量，并赋值为'Z'，不换行输出类型说明，换行输出变量值。
        10.定义 boolean 类型变量，并赋值为 false，不换行输出类型说明，换行输出变量值。
     */
    public static void n(){
        short a = 100;
        int b = 1000;
        long c = 10000;
        float d = 100000.0f;
        double e = 1000000.0;
        char f = 'Z';
        boolean g = false;
        System.out.print("整型变量short:");
        System.out.println("值："+a);
        System.out.print("整型变量int:");
        System.out.println("值："+b);
        System.out.print("整型变量long:");
        System.out.println("值："+c);
        System.out.print("浮点型变量float:");
        System.out.println("值："+d);
        System.out.print("浮点型变量double:");
        System.out.println("值："+e);
        System.out.print("字符变量char:");
        System.out.println("值："+f);
        System.out.print("布尔变量boolean:");
        System.out.println("值："+g);
    }
    public static void main(String[] args) {
        // 调用
        n();
    }

}